<?php include('functions.php'); ?>
<title>oPanel V<?php echo $ver; ?></title>
<link rel="stylesheet"href="style.css">
<link rel="shortcut icon" href="favicon.ico" />
<?php
if(!isset($_SESSION["pass"]) || !isset($_SESSION["user"])) {
echo '<script type="text/javascript">top.window.close()</script>';
exit;
}
if ($_SESSION["pass"] != check($_SESSION["user"])) {
echo '<script type="text/javascript">top.window.close()</script>';
exit;
}
if ($debug != true) {
$config_test = realpath("./config.php");
$oPanel_dir = dirname("$config_test");
if ($real_dir_full == $config_test) {
echo "<hr noshade>
<font class=med>$file</font>
&nbsp;<font class=med>Save Cancelled</font>
<hr noshade>
<font class=med><a href='edit.php?dir=$file'><center><font class=\"red\"><marquee>You can't edit the config for oPanel.</marquee></font></center></a></font>";
exit;
}
if ($real_dir == $oPanel_dir) {
echo "<hr noshade>
<font class=med>$file</font>
&nbsp;<font class=med>Save Cancelled</font>
<hr noshade>
<font class=med><a href='edit.php?dir=$file'><center><font class=\"red\"><marquee>You can't edit oPanel Files!</marquee></font></center></a></font>";
exit;
}
}
$location = $_POST['dir'];
$dir1 = stripslashes("$location");
$dir = "$dir1/";
$filename = $_POST['filename'];
$somecontent = $_POST['content'];
$file = "$dir$filename";

$fp = @fopen("$file","w+");
$content = stripslashes($somecontent);
fwrite($fp, $content);
fclose($fp);

   echo "
<hr noshade>
<font class=med>$file</font>
&nbsp;<font class=med>File Saved</font>
<hr noshade>
 
<font class=med><a href='edit.php?dir=$file'>Continue editing $filename</a></font>";
?> 
<div style="position: absolute; width: 264px; height: 17px; z-index: 1; bottom: 0px; left:10px" id="credits">
oPanel V<?php echo $ver; ?> by <a href="http://olliespage.net/" target ="_blank">OlliesPage.net</a></div>
<div style="position: absolute; width: 500px; height: 17px; z-index: 1; bottom: 0px; right: 19px; text-align: right" id="BetaTesters">
BETA testers: <?php echo $BETAtesters; ?></div>
